#include<iostream>

using namespace std;
//2323

int is_goodnum(int n){
	while(n){
		if(n%2==0)  return 0;
		n/=10;
		if(n%2==1)  return 0;
		n/=10;
	}
	return 1;
}

int main()
{
	int N;
	cin>>N;
    int k=0;
    for(int i=1;i<=N;i++){
    	if(is_goodnum(i))  k++;
	}
	cout<<k<<endl;
	return 0;
 } 
